package com.elinkway.infinitemovies.ui.activity.commonwebview;

import android.webkit.WebView;
import android.webkit.WebViewClient;

public class CommonWebViewClient extends WebViewClient {
	private final String TAG = "CommonWebViewClient";

	private CommonWebViewActivity mContext;

	public CommonWebViewClient(CommonWebViewActivity context) {
		mContext = context;
	}

	@Override
	public boolean shouldOverrideUrlLoading(WebView view, String url) {
		view.loadUrl(url);
		return true;
	}



	@Override
	public void onPageFinished(WebView view, String url) {
		super.onPageFinished(view, url);
//		mContext.getmWebView().loadUrl(js_getSrc);
	}

	public void destory() {
		mContext = null;
	}

//	private String js_getSrc="javascript:window.setInterval(_Hacked_getSrc, 2000);  function _Hacked_getSrc() { _Android_Hack.logSrc(\"start catch\");var videos = document.getElementsByTagName(\"video\");_Android_Hack.logSrc(videos.length);" +
//			"if(videos.length>0){"+
//			"var video = videos[0];" +
//			"videos[0].play();" +
//			"_Android_Hack.logSrc(video.getAttribute(\"src\"));}" +
//			"else{" +
//			"	_Android_Hack.logSrc(\"cant find video tag\");" +
//			"}}";
}
